summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_opengl/present/fsr.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/video_core/renderer_opengl/present/fsr.h')
-rw-r--r--src/video_core/renderer_opengl/present/fsr.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/video_core/renderer_opengl/present/fsr.h b/src/video_core/renderer_opengl/present/fsr.h
new file mode 100644
index 000000000..606935a01
--- /dev/null
+++ b/src/video_core/renderer_opengl/present/fsr.h
@@ -0,0 +1,39 @@
+// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+#pragma once
+
+#include <string_view>
+
+#include "common/common_types.h"
+#include "common/math_util.h"
+#include "video_core/fsr.h"
+#include "video_core/renderer_opengl/gl_resource_manager.h"
+
+namespace OpenGL {
+
+class ProgramManager;
+
+class FSR {
+public:
+ explicit FSR(u32 output_width, u32 output_height);
+ ~FSR();
+
+ GLuint Draw(ProgramManager& program_manager, GLuint texture, u32 input_image_width,
+ u32 input_image_height, const Common::Rectangle<f32>& crop_rect);
+
+ bool NeedsRecreation(const Common::Rectangle<u32>& screen);
+
+private:
+ const u32 width;
+ const u32 height;
+ OGLFramebuffer framebuffer;
+ OGLSampler sampler;
+ OGLProgram vert;
+ OGLProgram easu_frag;
+ OGLProgram rcas_frag;
+ OGLTexture easu_tex;
+ OGLTexture rcas_tex;
+};
+
+} // namespace OpenGL